def bin_search(array,target,left,right):
    if left > right:
        return None
    mid=(left+right)//2
    if array[mid] == target:
        return mid
    if array[mid] > target:
        return bin_search(array,target,left,mid-1)
    if array[mid] < target:
        return bin_search(array,target,mid+1,right)

def binary_search(array,target):
    return bin_search(array,target,0,len(array)-1)

array=[10,14,19,26,27,31,33,35,42,44]
print(array)
print(binary_search(array,31))